home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v11i047: gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Patch2i
- Message-ID: <6234@tekred.CNA.TEK.COM>
- Date: 28 Aug 90 19:36:48 GMT
- Sender: news@tekred.CNA.TEK.COM
- Lines: 1626
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: VANCLEEF@mps.ohio-state.edu
- Posting-number: Volume 11, Issue 47
- Archive-name: gb3/Patch2i
- Patch-To: gb3: Volume 10, Issue 1-14
-
-
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 9 (of 9)."
- # Contents: Docs/beginner.doc Docs/detonate.doc Docs/dissolve.doc
- # Docs/dump.doc Docs/lasers.doc Docs/motto.doc Docs/production.doc
- # Docs/read.doc Docs/repair.doc Docs/standby.doc Docs/stats.doc
- # SETUP client/client.h server/capitol.c server/config.h
- # server/dissolve.c server/files.h server/interface.h server/power.c
- # server/races.h server/relation.c server/shipdata.h server/tech.c
- # server/toggle.c
- # Wrapped by billr@saab on Tue Aug 28 08:55:01 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Docs/beginner.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/beginner.doc'\" to \"'Docs/beginner.doc.orig'\"
- mv -f 'Docs/beginner.doc' 'Docs/beginner.doc.orig'
- fi
- echo shar: Extracting \"'Docs/beginner.doc'\" \(2900 characters\)
- sed "s/^X//" >'Docs/beginner.doc' <<'END_OF_FILE'
- X If you are a beginner to Galactic Bloodshed (GB), no problem. The game
- Xmay seem a bit overwhelming at first, but so is everything at first :)
- XJust relax, get a cup of coffee, and enjoy. A typical GB game may last months
- Xand everything you do at first, even if you are out of touch for awhile,
- Xisn't totally critical! You can take off for the weekend, and have real life
- Xat the same time and come back to the game and have your race intact.
- X
- X At any rate, what *is* GB anyway? Well, it's a wargame. But it is also a
- Xcampaign style war game. It is also a game of diplomacy, making and breaking
- Xalliances, back stabbing, and megalomania! All accessible via the net!
- X
- X Basically, you start of with a race of people, and every race has it's own
- Xunique set of characteristics. What you want to do with this race is explore
- Xand maybe conquer the galaxy and be great big and famous and powerful...!
- XBUT, you can't do it alone, this is an important point ;)
- X
- X
- X Speaking of points, what is the *point* of GB in the first place?
- XWell, you want to *have fun*! Yes, that's the whole point of any game isn't
- Xit? If you don't want to have fun, stop reading here and may your first born
- Xhave the nose of camel and drink like one too :) In order to have fun you
- Xmust realise at first - not all races are the same! In fact, every race is
- Xdifferent. Every race has advantages and disadvatages. During the first set
- Xof updates, thing may seem uneven - but it's how you play the game in the
- Xlong run which matters! Trust me on this.
- X
- X Each turn in GB is called an 'update'. Updates are run at a schedule
- Xset by your game administrator (player #1 always!). During each update,
- Xyour population explores new sectors, the planets revolve about their
- Xprimaries (using Keppler's laws), ships are moved, production of resources,
- Xfuel, etc are made. In between updates you can order your ships, move
- Xyour people about on planets, attack enemy ships and planets, design your
- Xships etc...
- X
- X What you want to do at first, is gather 50 resources, and then build a
- Xfactory. A factory is essential to the game. These things build ships!
- XYou build a factory, then tell it what kind of ship design you want to
- Xmake. The available ship designs are based on your technology which grows
- Xeach update. It takes a factory time to be ready to build it's ship design.
- XOnce the factory is ready, you can build ships there!
- X
- X Next thing you want to do is explore the galaxy. Other planets in your
- Xhome star system should always be examined first. You might want to start
- Xcolonies on these. If you find a planet which you think your race can live
- Xon, land there and colonize!
- X
- X As the game goes on, you will definitely run into other races. Talk to them!
- XThey may be good allies in the end - or maybe horrid enemies. That's up to
- Xyou. There's a big universe out there! And remember to *have fun*!
- X
- X:)
- X
- XGarrett van Cleef
- X6-14-90
- X
- X
- X
- X
- END_OF_FILE
- if test 2900 -ne `wc -c <'Docs/beginner.doc'`; then
- echo shar: \"'Docs/beginner.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/beginner.doc'
- if test -f 'Docs/detonate.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/detonate.doc'\" to \"'Docs/detonate.doc.orig'\"
- mv -f 'Docs/detonate.doc' 'Docs/detonate.doc.orig'
- fi
- echo shar: Extracting \"'Docs/detonate.doc'\" \(381 characters\)
- sed "s/^X//" >'Docs/detonate.doc' <<'END_OF_FILE'
- XDETONATE Galactic Bloodshed DETONATE
- X
- X
- XNAME
- X detonate -- force a mine to explode
- X
- XSYNTAX
- X detonate <mine>
- X
- XDESCRIPTION
- X
- X Normally, a mine is set to detonate at a prearranged trigger radius
- Xusing the 'order' command. However, players may find it useful to order
- Xtheir space mines to explode upon request, between updates. This
- Xcommand is used to do this.
- X
- XSEE ALSO
- X order
- X
- END_OF_FILE
- if test 381 -ne `wc -c <'Docs/detonate.doc'`; then
- echo shar: \"'Docs/detonate.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/detonate.doc'
- if test -f 'Docs/dissolve.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/dissolve.doc'\" to \"'Docs/dissolve.doc.orig'\"
- mv -f 'Docs/dissolve.doc' 'Docs/dissolve.doc.orig'
- fi
- echo shar: Extracting \"'Docs/dissolve.doc'\" \(487 characters\)
- sed "s/^X//" >'Docs/dissolve.doc' <<'END_OF_FILE'
- XDISSOLVE Galactic Bloodshed DISSOLVE
- X
- X
- XNAME
- X dissolve -- resign your forces from play in the game.
- X
- XSYNTAX
- X dissolve <password>
- X
- XDESCRIPTION
- X
- X A player can resign from the game by issuing a dissolve command. All ships,
- Xsectors, resources, destruct, etc. are permanently eliminated from the game.
- XDissolved players also do not appear on power reports.
- X
- X You must specify your password to dissolve. Make sure you want to do this
- Xbefore using it, as all is immediately lost!
- X
- X
- X
- END_OF_FILE
- if test 487 -ne `wc -c <'Docs/dissolve.doc'`; then
- echo shar: \"'Docs/dissolve.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/dissolve.doc'
- if test -f 'Docs/dump.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/dump.doc'\" to \"'Docs/dump.doc.orig'\"
- mv -f 'Docs/dump.doc' 'Docs/dump.doc.orig'
- fi
- echo shar: Extracting \"'Docs/dump.doc'\" \(328 characters\)
- sed "s/^X//" >'Docs/dump.doc' <<'END_OF_FILE'
- XDUMP Galactic Bloodshed DUMP
- X
- X
- XNAME
- X [10] dump -- give another player your expl,oration data
- X
- XSYNTAX
- X dump <player>
- X
- XDESCRIPTION
- X
- X This allows a player to give another player (usually a trusted
- Xally) all of your exploration data. This information is permanently
- Xrecorded in the receiving player's exploration list.
- X
- X
- X
- END_OF_FILE
- if test 328 -ne `wc -c <'Docs/dump.doc'`; then
- echo shar: \"'Docs/dump.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/dump.doc'
- if test -f 'Docs/lasers.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/lasers.doc'\" to \"'Docs/lasers.doc.orig'\"
- mv -f 'Docs/lasers.doc' 'Docs/lasers.doc.orig'
- fi
- echo shar: Extracting \"'Docs/lasers.doc'\" \(1472 characters\)
- sed "s/^X//" >'Docs/lasers.doc' <<'END_OF_FILE'
- XLASERS Galactic Bloodshed LASERS
- X
- X
- XCONCEPT
- X lasers -- ships may mount combat lasers for use in battle.
- X
- XDESCRIPTION
- X
- X Some ships may be permitted to mount combat lasers at time
- Xof construction. Ships require a minimum technology of 100.
- XA ship which has a laser mounted may optionally
- Xuse these for firing instead of the normal guns. Unlike guns,
- Xlasers use fuel instead of destruct to attack with. Two points
- Xof fuel is equivalent to 1 gun. The player must also have a
- Xcrystal mounted to use the fuel for attacking.
- X
- X There is no limit to the amount of fuel that may used in
- Xan attack. However, there is a technological stability limit,
- Xbeyond which crystal damage may result, or even an explosion.
- X
- XShip explosion is determined by the formula:
- X Explosion if rand(0, strength) > ship tech/2.
- X
- XA 100 technology ship may fire up to 50 strength points safely, a
- X200 tech ship 100, etc. Pushing it beyond this limit may result
- Xin a matter/anti-matter explosion!
- X
- XCrystals may damage before they explode a ship. The chances of
- Xdamage (and hence an automatic dismount and loss of the crystal)
- Xis determined by
- X Damaged if rand(0, strength) > ship tech/4.
- X
- XA ship will only fire lasers if told to do so. This is done using
- Xthe order command 'order <ship> laser on <default strength>'.
- XThe laser may be turned off with 'order <ship> laser off'. If the
- Xlaser is set on, then executing the 'fire' command uses lasers
- Xinstead of normal weapons.
- X
- XSEE ALSO
- X fire, order
- X
- END_OF_FILE
- if test 1472 -ne `wc -c <'Docs/lasers.doc'`; then
- echo shar: \"'Docs/lasers.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/lasers.doc'
- if test -f 'Docs/motto.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/motto.doc'\" to \"'Docs/motto.doc.orig'\"
- mv -f 'Docs/motto.doc' 'Docs/motto.doc.orig'
- fi
- echo shar: Extracting \"'Docs/motto.doc'\" \(350 characters\)
- sed "s/^X//" >'Docs/motto.doc' <<'END_OF_FILE'
- XMOTTO Galactic Bloodshed MOTTO
- X
- X
- XNAME
- X motto -- set a motto for an alliance block
- X
- XSYNTAX
- X motto <motto>
- X
- XDESCRIPTION
- X
- X Players may give the alliance block they control a motto which
- Xwill show up on individual block reports. This is strictly for
- Xentertainment/communications and has no effect on the play of the game.
- X
- XSEE ALSO
- X blocks
- X
- END_OF_FILE
- if test 350 -ne `wc -c <'Docs/motto.doc'`; then
- echo shar: \"'Docs/motto.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/motto.doc'
- if test -f 'Docs/production.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/production.doc'\" to \"'Docs/production.doc.orig'\"
- mv -f 'Docs/production.doc' 'Docs/production.doc.orig'
- fi
- echo shar: Extracting \"'Docs/production.doc'\" \(348 characters\)
- sed "s/^X//" >'Docs/production.doc' <<'END_OF_FILE'
- XPRODUCTION Galactic Bloodshed PRODUCTION
- X
- X
- XNAME
- X production -- show latest planet production statistics
- X
- XSYNTAX
- X production
- X
- XDESCRIPTION
- X
- X This command will show the number of resources, fuel, and
- Xdestruct that a planet production during the previous update.
- XYou must change scope to the planet for this command to work.
- X
- XSEE ALSO
- X survey
- X
- END_OF_FILE
- if test 348 -ne `wc -c <'Docs/production.doc'`; then
- echo shar: \"'Docs/production.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/production.doc'
- if test -f 'Docs/read.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/read.doc'\" to \"'Docs/read.doc.orig'\"
- mv -f 'Docs/read.doc' 'Docs/read.doc.orig'
- fi
- echo shar: Extracting \"'Docs/read.doc'\" \(314 characters\)
- sed "s/^X//" >'Docs/read.doc' <<'END_OF_FILE'
- XREAD Galactic Bloodshed READ
- X
- X
- XNAME
- X [0] read -- read messages from other players and news
- X
- XSYNTAX
- X read <what>
- X
- XDESCRIPTION
- X
- X Read allows the player to look over messages sent to him by the other
- Xusers in the game. Players can also read the 'Galactic News' by doing
- X'read news'.
- X
- XSEE ALSO
- X telegram
- X
- END_OF_FILE
- if test 314 -ne `wc -c <'Docs/read.doc'`; then
- echo shar: \"'Docs/read.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/read.doc'
- if test -f 'Docs/repair.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/repair.doc'\" to \"'Docs/repair.doc.orig'\"
- mv -f 'Docs/repair.doc' 'Docs/repair.doc.orig'
- fi
- echo shar: Extracting \"'Docs/repair.doc'\" \(647 characters\)
- sed "s/^X//" >'Docs/repair.doc' <<'END_OF_FILE'
- XREPAIR Galactic Bloodshed REPAIR
- X
- X
- XNAME
- X [0] repair -- repair a planet/sectors
- X
- XSYNTAX
- X repair <xlow:xhi,ylow:yhi or x,y>
- X
- XDESCRIPTION
- X Players can repair sectors which have wasted designations, due to
- Xcombat or other effects. The player must change scope to the planet. If
- Xno arguments are given, all sectors will be repaired to the limit of available
- Xresources. A player must inhabit at least one sector and have 10 resources
- Xfor each sector repaired. If arguments are given, a rectangular area
- Xspecified by the player will be repaired. Note that only wasted sectors
- Xcan be repaired, and sectors inhabited by aliens may not be repaired.
- X
- X
- END_OF_FILE
- if test 647 -ne `wc -c <'Docs/repair.doc'`; then
- echo shar: \"'Docs/repair.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/repair.doc'
- if test -f 'Docs/standby.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/standby.doc'\" to \"'Docs/standby.doc.orig'\"
- mv -f 'Docs/standby.doc' 'Docs/standby.doc.orig'
- fi
- echo shar: Extracting \"'Docs/standby.doc'\" \(326 characters\)
- sed "s/^X//" >'Docs/standby.doc' <<'END_OF_FILE'
- XSTANDBY Galactic Bloodshed STANDBY
- X
- X
- XNAME
- X standby -- enter dormant mode
- X
- XSYNTAX
- X standby
- X
- XDESCRIPTION
- X
- X A player may enter standby mode, which doesn't use up time allotments,
- Xbut severely restricts the commands he/she may use. While in standby
- Xmode, a player may only issue communications commands.
- X
- XSEE ALSO
- X time
- END_OF_FILE
- if test 326 -ne `wc -c <'Docs/standby.doc'`; then
- echo shar: \"'Docs/standby.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/standby.doc'
- if test -f 'Docs/stats.doc' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'Docs/stats.doc'\" to \"'Docs/stats.doc.orig'\"
- mv -f 'Docs/stats.doc' 'Docs/stats.doc.orig'
- fi
- echo shar: Extracting \"'Docs/stats.doc'\" \(277 characters\)
- sed "s/^X//" >'Docs/stats.doc' <<'END_OF_FILE'
- XSTATS Galactic Bloodshed STATS
- X
- X
- XNAME
- X [0] stats -- report ship characteristics
- X
- XSYNTAX
- X status <#shipnum or ship types>
- X
- XDESCRIPTION
- X This command allows users to examine characteristics of their ships.
- X
- X
- XSEE ALSO
- X examine, ship, stock, tactical, scope, report
- X
- END_OF_FILE
- if test 277 -ne `wc -c <'Docs/stats.doc'`; then
- echo shar: \"'Docs/stats.doc'\" unpacked with wrong size!
- fi
- # end of 'Docs/stats.doc'
- if test -f 'SETUP' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'SETUP'\" to \"'SETUP.orig'\"
- mv -f 'SETUP' 'SETUP.orig'
- fi
- echo shar: Extracting \"'SETUP'\" \(2840 characters\)
- sed "s/^X//" >'SETUP' <<'END_OF_FILE'
- XFrom: vancleef@ohstpy.mps.ohio-state.edu
- XNewsgroups: alt.games.galactic-bloodshed
- XSubject: Compilation/Setup
- XDate: 2 Aug 90 21:21:14 GMT
- XLines: 56
- X
- XOK, several people have been requesting info on how to get GB set up, etc,
- Xand since I finally can get this new newsgroup, here we go.
- X
- XAll of the details on setting it up are in README1.3 - but here is a brief
- Xdescription.
- X
- XGB is divided into two parts, a 'server' which resides on the computer of
- Xthe person who is hosting the game. This person should be in charge of
- Xmaking sure everything is running smoothly, enrolling players, etc.
- XThe server communicates with players over the network. It processes command
- Xlines and send information to the appropriate players. The game is
- Xdesigned to be accessible 24 hrs a day, via the internet.
- XEach player should have a copy of the 'client'. If you dont want to host
- Xa game you needn't get the server, just the client. The client talks with
- Xserver and draws maps when they are requested. The server sends coded
- Xinformation which tells the client how to draw the maps.
- X
- XThe server and client as well as game docs are posted at an ftp site.
- XYou can obtain them from 'scam.berkeley.edu' (128.32.138.0) using
- Xanonymous ftp in the directory tmp/GB. Jeff Wallace maintains the
- Xftp site and compresses the code every few days or so. Since I post
- Xmodification to it regularly, it's probably a good idea to examine the
- Xdates on the files, as changes are made almost daily, get the latest
- Xversion. The server is in the file GB_server.shar, client in GB_client.shar,
- Xand docs in GB_docs.shar.
- X
- XSetting up a client:
- X obtain the GB_client.shar file and set up a client directory.
- X Then do 'sh GB_client.shar' and your system will unpack the
- X file. Then, do 'make' and your system should compile the
- X program. Note, you may have to make modifications to the
- X Makefile to get it to run on your system. See a local Unix
- X guru for help if you don't understand it.
- X
- X You can then connect to your favorite GB game by doing
- X 'GB_client <host> <port>'. e.g. - GB_client pooh.caltech.edu 2010
- X would get you to the caltech game (which is sorta dying now :)
- X
- XSetting up the server:
- X Obtain GB_server.shar, and set up a directory called 'GB' (my
- X suggestion). Then do 'sh GB_server.shar' and then 'make'.
- X Once again you may have to modify the Makefile to get it to
- X work on your system. The makee process will also produce other
- X programs, these are described in README1.3 which comes along
- X with the server.
- X
- XRemember, gb has come a long way and we are still working things out. Post
- X suggestions here or e-mail to vancleef@pooh.caltech.edu or
- X vancleef@ohstpy.mps.ohio-state.edu. You can also send to
- X Robert Chansky (address in previous posting)
- X
- X"Let the space battles begin!" - Jeff Wallace
- X
- Xdisclaimer: *** THIS MAY BE INCOMPATIBLE WITH SYSTEM/V ***
- X
- X-Garrett
- X
- X
- END_OF_FILE
- if test 2840 -ne `wc -c <'SETUP'`; then
- echo shar: \"'SETUP'\" unpacked with wrong size!
- fi
- # end of 'SETUP'
- if test -f 'client/client.h' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'client/client.h'\" to \"'client/client.h.orig'\"
- mv -f 'client/client.h' 'client/client.h.orig'
- fi
- echo shar: Extracting \"'client/client.h'\" \(294 characters\)
- sed "s/^X//" >'client/client.h' <<'END_OF_FILE'
- X#define VERS "1.3.1 7/25/90"
- X
- X#ifndef TRUE
- X#define TRUE 1
- X#endif
- X
- X#ifndef FALSE
- X#define FALSE 0
- X#endif
- X
- X#define MAXSTRLEN 8192
- X#define HUGESTRLEN (2*MAXSTRLEN + 1)
- X#define SMALLSTR 31
- X
- Xtypedef char string[MAXSTRLEN];
- Xtypedef char hugestr[HUGESTRLEN];
- Xtypedef char smallstr[SMALLSTR];
- END_OF_FILE
- if test 294 -ne `wc -c <'client/client.h'`; then
- echo shar: \"'client/client.h'\" unpacked with wrong size!
- fi
- # end of 'client/client.h'
- if test -f 'server/capitol.c' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/capitol.c'\" to \"'server/capitol.c.orig'\"
- mv -f 'server/capitol.c' 'server/capitol.c.orig'
- fi
- echo shar: Extracting \"'server/capitol.c'\" \(1969 characters\)
- sed "s/^X//" >'server/capitol.c' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
- X * Restrictions in GB_copyright.h.
- X *
- X * capitol.c -- designate a capitol
- X */
- X
- X#include "GB_copyright.h"
- X#define EXTERN extern
- X#include "vars.h"
- X#include "ships.h"
- X#include "races.h"
- X#include "buffers.h"
- X#include <signal.h>
- X
- Xint capitol_racedata;
- X
- Xcapitol(Playernum,APcount, argn,args)
- Xint Playernum;
- Xint APcount;
- Xint argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- Xint shipno,stat;
- Xint shdata;
- Xshiptype *s;
- Xracetype *Race;
- X
- Xopenracedata(&capitol_racedata);
- Xgetrace(capitol_racedata, &Race, Playernum);
- Xclose_file(capitol_racedata);
- X
- X if (argn!=2) {
- X shipno = Race->Gov_ship;
- X } else {
- X
- X shipno = atoi(args[1]+(args[1][0]=='#'));
- X
- X if (Dir[Playernum-1].level==LEVEL_UNIV) {
- X if (!enufAP(Playernum,Sdata.AP[Playernum-1],APcount)) {
- X free(Race);
- X return;
- X }
- X } else {
- X if (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1],APcount)) {
- X free(Race);
- X return;
- X }
- X }
- X }
- X
- Xif(shipno <= 0) {
- X notify(Playernum, "Change the capitol to be what ship?\n");
- X free(Race);
- X return;
- X }
- X
- X openshdata(&shdata);
- X stat = getship(shdata, &s, shipno);
- X close_file(shdata);
- X
- X if (argn==2) {
- X if (!stat || testship(Playernum,s, shipno)) {
- X free(Race);
- X free(s);
- X return;
- X }
- X
- X if (s->type!=OTYPE_GOV) {
- X sprintf(buf,"That ship is not a %s.\n",Shipnames[OTYPE_GOV]);
- X notify(Playernum, buf);
- X free(Race);
- X free(s);
- X return;
- X }
- X
- X if (Dir[Playernum-1].level==LEVEL_UNIV)
- X deductAPs(Playernum, APcount, 0, 1);
- X else
- X deductAPs(Playernum, APcount, Dir[Playernum-1].snum, 0);
- X
- X Race->Gov_ship = shipno;
- X openracedata(&capitol_racedata);
- X putrace(capitol_racedata, Race);
- X close_file(capitol_racedata);
- X
- X }
- X sprintf(buf,"Efficiency of governmental center: %.0f%%.\n",
- X ((float)s->popn/Max_crew(s)) *
- X (100 - (float)s->damage) );
- X notify(Playernum, buf);
- X free(Race);
- X free(s);
- X
- X}
- END_OF_FILE
- if test 1969 -ne `wc -c <'server/capitol.c'`; then
- echo shar: \"'server/capitol.c'\" unpacked with wrong size!
- fi
- # end of 'server/capitol.c'
- if test -f 'server/config.h' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/config.h'\" to \"'server/config.h.orig'\"
- mv -f 'server/config.h' 'server/config.h.orig'
- fi
- echo shar: Extracting \"'server/config.h'\" \(760 characters\)
- sed "s/^X//" >'server/config.h' <<'END_OF_FILE'
- X#include "files.h" /* for PATH() definition */
- X
- X#define VERS "2.2.3 8/23/90"
- X
- X#ifndef GB_HOST
- X#define GB_HOST "pooh.caltech.edu"
- X#endif
- X
- X#ifndef GB_PORT
- X#define GB_PORT 2010
- X#endif
- X
- X
- X#define COMMAND_TIME_MSEC 250 /* time slice length in milliseconds */
- X#define COMMANDS_PER_TIME 1 /* commands per time slice after burst */
- X#define COMMAND_BURST_SIZE 250 /* commands allowed per user in a burst */
- X#define DISCONNECT_TIME 7200 /* maximum idle time */
- X#define MAX_OUTPUT 32768
- X#define DAEMON_PASSWORD "put_your_update_password_here"
- X
- X#define QUIT_COMMAND "quit"
- X#define WHO_COMMAND "who"
- X#define HELP_COMMAND "help"
- X
- X/* put full pathnames in here as required */
- X#define WELCOME_FILE PATH(welcome.txt)
- X#define LEAVE_MESSAGE "\n*** Have a nice day :-) ***\n"
- END_OF_FILE
- if test 760 -ne `wc -c <'server/config.h'`; then
- echo shar: \"'server/config.h'\" unpacked with wrong size!
- fi
- # end of 'server/config.h'
- if test -f 'server/dissolve.c' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/dissolve.c'\" to \"'server/dissolve.c.orig'\"
- mv -f 'server/dissolve.c' 'server/dissolve.c.orig'
- fi
- echo shar: Extracting \"'server/dissolve.c'\" \(3661 characters\)
- sed "s/^X//" >'server/dissolve.c' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
- X * Restrictions in GB_copyright.h.
- X * dissolve.c -- commit suicide, nuke all ships and sectors;
- X * July 24th, 1989, John Deragon, cruz@cadman.nyu.edu
- X */
- X
- X#include "GB_copyright.h"
- X#define EXTERN extern
- X#include "vars.h"
- X#include "ships.h"
- X#include "races.h"
- X#include "doturn.h"
- X#include "power.h"
- X#include "buffers.h"
- X#include <math.h>
- X
- X
- Xdissolve(Playernum, argn, args)
- Xint Playernum;
- Xint argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- X
- Xint shdata, pdata, racedata, stardata, sectdata, n_ships;
- Xint i, z, x, y, x2, y2, hix, hiy, lowx,lowy;
- Xboolean waste;
- Xshiptype *sp;
- Xracetype *Race;
- Xplanettype *pl;
- Xsectortype *s;
- Xchar nuke;
- Xchar buf[1024][100];
- Xchar password[100];
- X
- Xopenshdata(&shdata);
- Xn_ships = Numships(shdata);
- Xclose_file(shdata);
- X
- Xif (argn < 2) {
- X sprintf(buf, "Self-Destruct sequence requires password.\n");
- X notify(Playernum, buf);
- X sprintf(buf, "Please use 'dissolve <your password> '<option> to initiate\n");
- X notify(Playernum, buf);
- X sprintf(buf, "self-destruct sequence.\n");
- X notify(Playernum, buf);
- X return;
- X } else {
- X sprintf(buf, "WARNING!! WARNING!! WARNING!!\n");
- X notify(Playernum, buf);
- X sprintf(buf, "-------------------------------\n");
- X notify(Playernum, buf);
- X sprintf(buf, "Entering self destruct sequence!\n");
- X notify(Playernum, buf);
- X
- X
- X sscanf(args[1], "%s", password);
- X
- X
- X waste = 0;
- X if(argn > 2) {
- X sscanf(args[2], "%c", &nuke);
- X if (nuke == 'w')
- X waste = 1;
- X }
- X
- X i = Getracenum(password);
- X
- X if (!i) {
- X sprintf(buf, "Password mismatch, self-destruct not initiated!\n");
- X notify(Playernum, buf);
- X return;
- X }
- X
- Xopenshdata(&shdata);
- Xfor (i=1; i<=n_ships; i++) {
- X getship(shdata,&sp, i);
- X if (sp->owner == Playernum) {
- X kill_ship(Playernum, sp);
- X makeshipdead(i);
- X sprintf(buf, "Ship #%d, self-destruct enabled\n",i);
- X notify(Playernum, buf);
- X putship(shdata, sp, i);
- X }
- X free(sp);
- X}
- Xclose_file(shdata);
- X
- X openstardata(&stardata);
- X getsdata(stardata,&Sdata);
- X openpdata(&pdata);
- X opensectdata(§data);
- Xfor (z=0; z<Sdata.numstars; z++) {
- X free(Stars[z]);
- X getstar(stardata, &(Stars[z]), z);
- X if (isset(Stars[z]->explored,Playernum)) {
- X for (i=0; i<Stars[z]->numplanets; i++) {
- X getplanet(pdata,&pl,Stars[z]->planetpos[i]);
- X
- X if (pl->info[Playernum-1].explored
- X && pl->info[Playernum-1].numsectsowned) {
- X pl->info[Playernum-1].numsectsowned = 0;
- X pl->info[Playernum-1].explored = 0;
- X pl->info[Playernum-1].resource = 0;
- X pl->info[Playernum-1].destruct = 0;
- X pl->info[Playernum-1].fuel = 0;
- X pl->popn = 0;
- X
- X }
- X
- X getsmap(sectdata,Smap,pl);
- X
- X
- X lowx = 0;
- X lowy = 0;
- X hix = pl->Maxx-1;
- X hiy = pl->Maxy-1;
- X for (y2=lowy; y2<=hiy; y2++) {
- X for (x2=lowx; x2<=hix; x2++) {
- X s = &Sector(*pl,x2,y2);
- X if (s->owner == Playernum) {
- X s->owner = 0;
- X s->popn = 0;
- X if (waste)
- X s->is_wasted = 1;
- X }
- X }
- X }
- X putsmap(sectdata,Smap,pl);
- X putstar(stardata, Stars[z], z);
- X putplanet(pdata,pl,Stars[z]->planetpos[i]);
- X free(pl);
- X }
- X }
- X }
- Xclose_file(pdata);
- Xclose_file(stardata);
- Xclose_file(sectdata);
- X
- X openracedata(&racedata);
- X getrace(racedata, &Race, Playernum);
- X Race->dissolved = 1;
- X putrace(racedata, Race);
- X close_file(racedata);
- X
- X for(i=1; i<=Numraces(); i++)
- X if(i!=Playernum) {
- X sprintf(buf, "%s [%d] has dissolved.\n", Race->name, Playernum);
- X if(!notify(i, buf))
- X push_message(TELEG_PLAYER_AUTO, i, buf, DECLARATION);
- X }
- X free(Race);
- X }
- X}
- END_OF_FILE
- if test 3661 -ne `wc -c <'server/dissolve.c'`; then
- echo shar: \"'server/dissolve.c'\" unpacked with wrong size!
- fi
- # end of 'server/dissolve.c'
- if test -f 'server/files.h' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/files.h'\" to \"'server/files.h.orig'\"
- mv -f 'server/files.h' 'server/files.h.orig'
- fi
- echo shar: Extracting \"'server/files.h'\" \(1475 characters\)
- sed "s/^X//" >'server/files.h' <<'END_OF_FILE'
- X#ifndef _FILES_H_
- X#define _FILES_H_
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
- X * Restrictions in GB.c.
- X */
- X
- X
- X#ifdef __STDC__
- X/*# define PATH(file) "/Net/pooh/Users/Staff/vancleef/GB/" #file */
- X#define PATH(file) #file
- X# define DFILE(fl) PATH(Data/) #fl
- X#else
- X# define PATH(file) "/usr/net/games/lib/GB/file"
- X# define DFILE(fl) "/usr/net/games/lib/GB/Data/fl"
- X#endif
- X
- X#define PATHLEN 200 /* length of file paths to the game.. */
- X
- X#define CUTE_MESSAGE "\nThe Galactic News\n\n"
- X#define TELEGRAM 0
- X#define DECLARATION 1
- X#define TRANSFER 2
- X#define COMBAT 3
- X#define ANNOUNCE 4
- X
- X#define PAGER Files[0]
- X#define DATADIR Files[1]
- X#define DOCS Files[2]
- X#define EXAM_FL Files[3]
- X#define ENROLL_FL Files[4]
- X#define DO_TURN Files[5]
- X#define STARDATAFL Files[6]
- X#define SECTORDATAFL Files[7]
- X#define PLANETDATAFL Files[8]
- X#define RACEDATAFL Files[9]
- X#define BLOCKDATAFL Files[10]
- X#define SHIPDATAFL Files[11]
- X#define SHIPFREEDATAFL Files[12]
- X#define DUMMYFL Files[13]
- X#define PLAYERDATAFL Files[14]
- X#define TELEGRAMDIR Files[15]
- X#define TELEGRAMFL Files[16]
- X#define POWFL Files[17]
- X#define LOCK_ALL Files[18]
- X#define NEWSDIR Files[19]
- X#define DECLARATIONFL Files[20]
- X#define TRANSFERFL Files[21]
- X#define COMBATFL Files[22]
- X#define ANNOUNCEFL Files[23]
- X
- X#define PLANETLIST "planet.list"
- X
- X#define PROFDATAFL PATH(spitup)
- X#define DAEMONFL PATH(daemon.dat)
- X
- Xextern char *Files[];
- X#endif
- END_OF_FILE
- if test 1475 -ne `wc -c <'server/files.h'`; then
- echo shar: \"'server/files.h'\" unpacked with wrong size!
- fi
- # end of 'server/files.h'
- if test -f 'server/interface.h' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/interface.h'\" to \"'server/interface.h.orig'\"
- mv -f 'server/interface.h' 'server/interface.h.orig'
- fi
- echo shar: Extracting \"'server/interface.h'\" \(443 characters\)
- sed "s/^X//" >'server/interface.h' <<'END_OF_FILE'
- X#include "TinyMUD_copyright.h"
- X
- X/* these symbols must be defined by the interface */
- Xextern int notify();
- Xextern int shutdown_flag; /* if non-zero, interface should shut down */
- Xextern void emergency_shutdown();
- X
- X/* the following symbols are provided by game.c */
- X
- X/* max length of command argument to process_command */
- X#define MAX_COMMAND_LEN 512
- X#define BUFFER_LEN ((MAX_COMMAND_LEN)*8)
- Xextern void process_command();
- X
- Xextern void panic();
- END_OF_FILE
- if test 443 -ne `wc -c <'server/interface.h'`; then
- echo shar: \"'server/interface.h'\" unpacked with wrong size!
- fi
- # end of 'server/interface.h'
- if test -f 'server/power.c' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/power.c'\" to \"'server/power.c.orig'\"
- mv -f 'server/power.c' 'server/power.c.orig'
- fi
- echo shar: Extracting \"'server/power.c'\" \(4434 characters\)
- sed "s/^X//" >'server/power.c' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
- X * Restrictions in GB_copyright.h.
- X *
- X * Galactic Bloodshed (Robert Chansky, smq@ucscb.ucsc.edu)
- X * power.c -- display power report
- X */
- X
- X#include "GB_copyright.h"
- X#define EXTERN extern
- X#include "vars.h"
- X#include "races.h"
- X#include "power.h"
- X#include "buffers.h"
- X#include <errno.h>
- X#include <time.h>
- Xextern int errno;
- Xextern struct tm *update_tm;
- Xint power_racedata;
- X
- Xblock(Playernum,APcount, argn,args)
- Xint Playernum;
- Xint APcount, argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- Xregister int i,n;
- Xint power_fd, p;
- Xracetype *r;
- Xint dummy;
- X
- X n = Numraces();
- X
- Xif(argn > 1) {
- X
- X GetPlayer(args[1], &p, &r);
- Xif(p < 1 || p > n) {
- X notify(Playernum, "No such player,\n");
- X return;
- X }
- Xfree(r);
- X
- X/* list the players who are in this alliance block */
- X dummy=(Blocks[p-1].invite & Blocks[p-1].pledge);
- X
- X sprintf(buf," ========== %s Power Report ==========\n",
- X Blocks[p-1].name);
- X notify(Playernum, buf);
- X sprintf(buf," %-64.64s\n",
- X Blocks[p-1].motto);
- X notify(Playernum, buf);
- X sprintf(buf," # Name sects popn eff mob #shp #plan res fuel dest\n");
- X notify(Playernum, buf);
- X
- Xopenracedata(&power_racedata);
- Xfor(i=1; i<=n; i++)
- X if(isset(dummy, i)) {
- X getrace(power_racedata, &r,(int)i);
- X if(!r->dissolved) {
- X sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u\n",
- X i, r->name,
- X Power[i-1].sectors_owned, Power[i-1].popn,
- X Power[i-1].sectors_owned ?
- X (float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
- X Power[i-1].sectors_owned ?
- X (float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
- X Power[i-1].ships_owned, Power[i-1].planets_owned,
- X Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct);
- X notify(Playernum, buf);
- X }
- X free(r);
- X }
- Xclose_file(power_racedata);
- X
- X } else { /* list power report for all the alliance blocks (as of the last update) */
- X sprintf(buf," ========== Alliance Blocks as of %s ==========\n",
- X Power_blocks.time);
- X notify(Playernum, buf);
- X sprintf(buf," # Name members sects popn ship systems res fuel dest VPs\n");
- X notify(Playernum, buf);
- Xfor(i=1; i<=n; i++)
- X if(Blocks[i-1].VPs) {
- X sprintf(buf,"%2d %-19.19s%3d%7u%8u%5u%6u%7u%7u%7u%6u\n",
- X i, Blocks[i-1].name, Power_blocks.members[i-1],
- X Power_blocks.sectors_owned[i-1], Power_blocks.popn[i-1],
- X Power_blocks.ships_owned[i-1], Power_blocks.systems_owned[i-1],
- X Power_blocks.resource[i-1], Power_blocks.fuel[i-1],
- X Power_blocks.destruct[i-1], Power_blocks.VPs[i-1]);
- X notify(Playernum, buf);
- X }
- X }
- X
- X}
- X
- X
- X
- Xpower(Playernum,APcount, argn,args)
- Xint Playernum;
- Xint APcount, argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- Xregister int i,n;
- Xint power_fd, p;
- Xracetype *r, *Race;
- X
- Xn = Numraces();
- Xp = -1;
- X
- Xif(argn>=2) {
- X GetPlayer(args[1], &p, &r);
- Xif(p < 1 || p > n) {
- X notify(Playernum, "No such player,\n");
- X return;
- X }
- X free(r);
- X }
- X
- Xopenracedata(&power_racedata);
- Xgetrace(power_racedata, &Race, Playernum);
- X
- X sprintf(buf," ========== Galactic Bloodshed Power Report ==========\n");
- X notify(Playernum, buf);
- X sprintf(buf," # Name sects popn eff mob #shp #plan res fuel dest%s\n",
- X (Race->God ? " VNs" : ""));
- X notify(Playernum, buf);
- X
- X for (i=1; i<=n; i++)
- X if(argn < 2 || i==p) {
- X getrace(power_racedata, &r, (int)i);
- X if(!r->dissolved) {
- X if(Race->God)
- X sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u%4u\n",
- X i, r->name,
- X Power[i-1].sectors_owned, Power[i-1].popn,
- X Power[i-1].sectors_owned ?
- X (float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
- X Power[i-1].sectors_owned ?
- X (float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
- X Power[i-1].ships_owned, Power[i-1].planets_owned,
- X Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct,
- X Sdata.VN_hitlist[i-1]);
- X else
- X sprintf(buf,"%2d %-20.20s%5u%7u%4.0f%4.0f%5u%6u%7u%7u%7u\n",
- X i, r->name,
- X Power[i-1].sectors_owned, Power[i-1].popn,
- X Power[i-1].sectors_owned ?
- X (float)Power[i-1].sum_eff/Power[i-1].sectors_owned : 0.0,
- X Power[i-1].sectors_owned ?
- X (float)Power[i-1].sum_mob/Power[i-1].sectors_owned : 0.0,
- X Power[i-1].ships_owned, Power[i-1].planets_owned,
- X Power[i-1].resource, Power[i-1].fuel, Power[i-1].destruct);
- X
- X notify(Playernum, buf);
- X }
- X free(r);
- X }
- Xclose_file(power_racedata);
- Xfree(Race);
- X}
- X
- X
- X
- END_OF_FILE
- if test 4434 -ne `wc -c <'server/power.c'`; then
- echo shar: \"'server/power.c'\" unpacked with wrong size!
- fi
- # end of 'server/power.c'
- if test -f 'server/races.h' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/races.h'\" to \"'server/races.h.orig'\"
- mv -f 'server/races.h' 'server/races.h.orig'
- fi
- echo shar: Extracting \"'server/races.h'\" \(2615 characters\)
- sed "s/^X//" >'server/races.h' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
- X * Restrictions in GB.c.
- X */
- X
- X
- Xstruct race {
- X int Playernum;
- X char name[RNAMESIZE];
- X char motto[64]; /* for a cute message */
- X float tech; /* technology */
- X float birthrate;
- X float overbirthrate;
- X percent fighters;
- X percent IQ;
- X percent number_sexes;
- X float mass;
- X float metabolism;
- X float adventurism;
- X short conditions[OTHER+1]; /* planetary conditions you like */
- X char deflevel;
- X char defsystem;
- X char defplanetnum; /* current default */
- X char homelevel;
- X char homesystem;
- X char homeplanetnum; /* home place */
- X float likes[DES_PLATED+1]; /* what territories they like */
- X char likesbest;
- X percent translate[MAXPLAYERS]; /* translation mod for each player */
- X percent captured_prisoners[MAXPLAYERS]; /* goes up with planetary contact */
- X unsigned int atwar; /* war 32 bits*/
- X unsigned int allied; /* allies 32 bits*/
- X unsigned short Gov_ship;
- X
- X short gag; /*options for toggle */
- X short double_digits;
- X short inverse;
- X short geography;
- X short autoload;
- X unsigned short highlight; /* which race to highlight */
- X
- X short C_C; /* berserker control code */
- X short standby;
- X
- X short color; /* whether or not you are using a color client */
- X short dissolved;
- X short weekly; /* weekly allocation time */
- X short daily; /* active time left over for the day */
- X short dummy4;
- X
- X short God; /* whether or not the race has God status */
- X short Thing;
- X
- X};
- X
- Xstruct block {
- X int Playernum;
- X char name[RNAMESIZE];
- X char motto[64];
- X unsigned int invite;
- X unsigned int pledge;
- X unsigned int atwar;
- X unsigned int allied;
- X unsigned short next;
- X unsigned short systems_owned;
- X unsigned VPs;
- X
- X unsigned dummy;
- X unsigned dummy1;
- X unsigned dummy2;
- X
- X};
- X
- Xstruct power_blocks {
- X char time[128];
- X unsigned members[MAXPLAYERS];
- X unsigned popn[MAXPLAYERS]; /* total population */
- X unsigned resource[MAXPLAYERS]; /* total resource in stock */
- X unsigned fuel[MAXPLAYERS];
- X unsigned destruct[MAXPLAYERS]; /* total dest in stock */
- X unsigned short ships_owned[MAXPLAYERS]; /* # of ships owned */
- X unsigned short systems_owned[MAXPLAYERS];
- X unsigned sectors_owned[MAXPLAYERS];
- X unsigned short VPs[MAXPLAYERS];
- X
- X unsigned dummy;
- X unsigned dummy1;
- X };
- X
- Xtypedef struct race racetype;
- Xtypedef struct block blocktype;
- XEXTERN struct block Blocks[MAXPLAYERS];
- XEXTERN struct power_blocks Power_blocks;
- XEXTERN int Block_start;
- X
- XEXTERN racetype *races[MAXPLAYERS];
- END_OF_FILE
- if test 2615 -ne `wc -c <'server/races.h'`; then
- echo shar: \"'server/races.h'\" unpacked with wrong size!
- fi
- # end of 'server/races.h'
- if test -f 'server/relation.c' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/relation.c'\" to \"'server/relation.c.orig'\"
- mv -f 'server/relation.c' 'server/relation.c.orig'
- fi
- echo shar: Extracting \"'server/relation.c'\" \(1807 characters\)
- sed "s/^X//" >'server/relation.c' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
- X * Restrictions in GB_copyright.h.
- X *
- X * relation.c -- state relations among players
- X */
- X
- X#include "GB_copyright.h"
- X#define EXTERN extern
- X#include "vars.h"
- X#include "races.h"
- X#include "ships.h"
- X#include "buffers.h"
- X
- Xextern char *Desnames[];
- Xchar *allied();
- Xint relation_racedata;
- X
- Xrelation(Playernum,APcount, argn, args)
- Xint Playernum;
- Xint APcount, argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- Xint numraces;
- Xint p, q;
- Xracetype *r, *Race;
- X
- X numraces = Numraces();
- X
- Xif(argn==1) {
- X q = Playernum;
- X} else {
- X GetPlayer(args[1], &q, &Race);
- X if(q < 1 || q > numraces) {
- X notify(Playernum, "No such player.\n");
- X return;
- X }
- X}
- X
- Xopenracedata(&relation_racedata);
- Xif(argn==1) getrace(relation_racedata, &Race, q);
- X
- X
- X sprintf(buf,"\n Racial Relations Report for %s\n\n",Race->name);
- X notify(Playernum, buf);
- X sprintf(buf," # know Race name Yours Theirs \n");
- X notify(Playernum, buf);
- X sprintf(buf," - ---- --------- ----- ------ \n");
- X notify(Playernum, buf);
- Xfor (p=1; p<=numraces; p++)
- X if (p != Race->Playernum) {
- X getrace(relation_racedata, &r, (int)p);
- X sprintf(buf,"%2d %s (%3d%%) %20.20s : %10s %10s\n", p,
- X ((Race->God || Race->translate[p-1] > 30) && r->Thing) ?
- X "Meso" : " ", Race->translate[p-1], r->name,
- X allied(Race, p, 100, Race->God),
- X allied(r, q,Race->translate[p-1], Race->God) );
- X notify(Playernum, buf);
- X free(r);
- X }
- Xfree(Race);
- Xclose_file(relation_racedata);
- X
- X
- X}
- X
- X
- X
- Xchar *allied(r, p, q, God)
- Xracetype *r;
- Xint p,q,God;
- X{
- X if (isset( r->atwar, p)) return "WAR";
- X else if (isset( r->allied, p)) return "ALLIED";
- X else return "neutral";
- X}
- X
- X
- X
- X
- END_OF_FILE
- if test 1807 -ne `wc -c <'server/relation.c'`; then
- echo shar: \"'server/relation.c'\" unpacked with wrong size!
- fi
- # end of 'server/relation.c'
- if test -f 'server/shipdata.h' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/shipdata.h'\" to \"'server/shipdata.h.orig'\"
- mv -f 'server/shipdata.h' 'server/shipdata.h.orig'
- fi
- echo shar: Extracting \"'server/shipdata.h'\" \(4424 characters\)
- sed "s/^X//" >'server/shipdata.h' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
- X * Restrictions in GB.c.
- X */
- X
- Xchar Shipltrs[]={ 'p','s','X','D','B','I','C','d','f','e','H','S','O','c',
- X 't','!','+','m',
- X '=','\\','-','a','g','v','V','Q','L','w',':','G','F',
- X 'T','&','A','[','R','P'};
- X
- Xint Shipdata[NUMSTYPES][NUMABILS] = {
- X /* carg dest guns fuelcap tech crw arm cst jmp lnd sw sp dm bd cn mod las prg*/
- X/*SPd*/ 1, 1, 0, 20, 1, 1, 0, 10, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1,
- X/*Shu*/ 25, 2, 1, 20, 10, 5, 0, 40, 0, 1, 0, 4, 0, 3, 2, 1, 0, 1,
- X/*Car*/ 600, 800, 30, 1000, 250, 60, 5, 700, 1, 0, 0, 4, 50, 2, 1, 1, 1, 1,
- X/*Drn*/ 500, 500, 60, 500, 500, 40, 10,1000, 1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
- X/*BB */ 235, 400, 30, 200, 200, 30, 7, 400, 1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
- X/*Int*/ 110, 120, 30, 200, 200, 10, 2, 300, 1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
- X/*CA */ 165, 300, 20, 120, 150, 20, 5, 200, 1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
- X/*DD */ 110, 120, 15, 80, 100, 10, 3, 100, 1, 1, 0, 6, 50, 3, 1, 1, 1, 1,
- X/*FF */ 0, 40, 20, 8, 100, 1, 0, 40, 1, 1, 0, 6, 0, 3, 1, 1, 1, 1,
- X/*Exp*/ 0, 15, 5, 35, 20, 2, 1, 40, 1, 1, 0, 6, 0, 3, 0, 1, 1, 1,
- X/*Hab*/5000, 500, 20, 2000, 100,2000, 3,1000, 1, 0, 0, 4, 75, 2, 2, 0, 1, 1,
- X/*Stn*/5000, 250, 20, 2000, 100, 50, 1, 400, 1, 0, 0, 4, 75, 2, 2, 0, 1, 1,
- X/*OSP*/1400, 1000, 50, 2000, 200,200, 5,1600, 1, 0, 0, 4, 75, 2, 2, 1, 1, 1,
- X/*Crg*/1000, 1000, 10, 1000, 100,100, 2, 100, 1, 1, 0, 4, 0, 3, 2, 1, 0, 1,
- X/*Tnk*/ 200, 200, 10, 5000, 100, 10, 2, 100, 1, 1, 0, 4, 0, 3, 1, 1, 0, 1,
- X/*GOD*/20000,20000,20000,20000, 5000,100, 10, 100, 1, 1, 0, 9, 0, 0, 2, 1, 1, 1,
- X/*SMn*/ 0, 50, 0, 20, 50, 0, 1, 25, 0, 1, 1, 4, 0, 1, 0, 0, 0, 1,
- X /* carg dest guns fuelcap tech crw arm cst jmp lnd sw sp dm bd cn mod prg*/
- X/*mir*/ 200, 10, 1, 20, 100, 5, 0, 200, 0, 0, 0, 2, 75, 2, 0, 0, 0, 1,
- X/*Stc*/ 0, 0, 0, 20, 50, 2, 0, 50, 1, 1, 0, 4, 0, 3, 0, 1, 0, 1,
- X/*Tsc*/ 0, 0, 0, 0, 5, 2, 0, 10, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
- X/*T-R*/ 0, 0, 0, 1000, 100, 5, 0, 400, 0, 1, 1, 2, 0, 0, 0, 0, 0, 1,
- X/*APr*/ 0, 0, 0, 200, 50, 10, 1, 80, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1,
- X/*CD */ 0, 1, 0, 1, 40, 0, 0, 20, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1,
- X/*VN */ 20, 1, 0, 50, 80, 0, 1, 30, 0, 1, 1, 2, 0, 0, 0, 0, 0, 1,
- X/*Bers*/ 50, 500, 40, 1000,10000, 0, 10, 100, 0, 1, 1, 4, 0, 0, 0, 0, 0, 1,
- X/*Gov*/ 500, 100, 20, 1000, 0, 10, 20,1500, 1, 1, 0, 2, 75, 0, 0, 0, 0, 1,
- X/*OMCL*/ 0, 100, 10, 100, 350, 2, 1, 100, 0, 1, 1, 4, 0, 0, 0, 0, 0, 1,
- X/*TWC*/ 0, 1, 0, 20, 25, 0, 0, 10, 0, 1, 0, 2, 0, 0, 0, 0, 0, 1,
- X/*Prb*/ 0, 1, 0, 20, 200, 0, 0, 40, 1, 1, 0, 9, 0, 1, 0, 0, 0, 1,
- X /* carg dest guns fuelcap tech crw arm cst jmp ln sw sp dm bd cn mod prg*/
- X/*GRL */ 50, 120, 40, 0, 100, 5, 3, 100, 0, 1, 0, 0, 50, 0, 0, 0, 0, 1,
- X/*Fac*/ 0, 0, 0, 0, 0, 20, 5, 50, 0, 1, 1, 0, 75, 0, 3, 0, 0, 1,
- X/*TFD*/ 0, 0, 0, 200, 70, 20, 1, 200, 1, 1, 1, 4, 0, 0, 0, 0, 0, 1,
- X/*BCC*/ 200, 50, 5, 0,99999, 0, 10, 3, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
- X/*BAf*/1000, 1000, 0, 1000,99999, 0, 10, 8, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
- X/*TD */1000, 1000, 0, 1000, 400,100, 0,1200, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1,
- X/*SRp*/ 0, 0, 0, 0, 100, 0, 0, 10, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
- X/*PDN*/ 0, 500, 20, 0, 200, 50, 20, 500, 0, 1, 0, 0, 75, 0, 0, 0, 0, 1
- X};
- X
- Xchar *Shipnames[NUMSTYPES] = {
- X "Spore pod",
- X "Shuttle",
- X "Carrier",
- X "Dreadnaught",
- X "Battleship",
- X "Interceptor",
- X "Cruiser",
- X "Destroyer",
- X "Fighter Group",
- X "Explorer",
- X "Habitat",
- X "Station",
- X "Ob Asst Pltfrm",
- X "Cargo Ship",
- X "Tanker",
- X "GODSHIP",
- X "Space Mine",
- X "Space Mirror",
- X "Space Telescope",
- X "Ground Telescope",
- X "* T-R beam",
- X "Atmosph Processor",
- X "Canister of dust",
- X "V.Neumann Machine",
- X "Berserker",
- X "Govrnmnt. Center",
- X "Mind Control Lsr",
- X "Tox Waste Canistr",
- X "Space Probe",
- X "Gamma Ray Laser",
- X "Factory",
- X "Terraform Device",
- X "Bers Cntrl Center",
- X "Bers Autofac",
- X "AVPM Transporter",
- X "Sector Repair",
- X "Planet Def Net"
- X};
- END_OF_FILE
- if test 4424 -ne `wc -c <'server/shipdata.h'`; then
- echo shar: \"'server/shipdata.h'\" unpacked with wrong size!
- fi
- # end of 'server/shipdata.h'
- if test -f 'server/tech.c' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/tech.c'\" to \"'server/tech.c.orig'\"
- mv -f 'server/tech.c' 'server/tech.c.orig'
- fi
- echo shar: Extracting \"'server/tech.c'\" \(2001 characters\)
- sed "s/^X//" >'server/tech.c' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
- X * Restrictions in GB_copyright.h.
- X *
- X * tech.c -- increase investment in technological development.
- X */
- X
- X#include "GB_copyright.h"
- X#define EXTERN extern
- X#include "vars.h"
- X#include "races.h"
- X#include "buffers.h"
- X#include <math.h>
- X#include <signal.h>
- X#include <ctype.h>
- Xint tech_pdata;
- X
- Xtechnology(Playernum,APcount, argn, args)
- Xint Playernum;
- Xint APcount, argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- Xint c,invest;
- Xplanettype *p;
- Xfloat tech_prod();
- X
- Xtech_pdata = NEUTRAL_FD;
- X
- Xif (Dir[Playernum-1].level != LEVEL_PLAN) {
- X sprintf(buf,"scope must be a planet (%d).\n", Dir[Playernum-1].level);
- X notify(Playernum, buf);
- X return;
- X}
- Xif (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount)) {
- X return;
- X }
- X
- X openpdata(&tech_pdata);
- X getplanet(tech_pdata,&p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
- Xclose_file(tech_pdata);
- X
- Xif(argn < 2) {
- X sprintf(buf, "Current investment : %d Technology production/update: %.3f\n",
- X p->info[Playernum-1].tech_invest,
- X tech_prod((int)p->info[Playernum-1].tech_invest,
- X (int)p->info[Playernum-1].popn));
- X notify(Playernum, buf);
- X free(p);
- X return;
- X }
- X
- X invest=atoi(args[1]);
- X
- X if (invest < 0) {
- X sprintf(buf,"Illegal value.\n");
- X notify(Playernum, buf);
- X free(p);
- X return;
- X }
- X
- Xp->info[Playernum-1].tech_invest = invest;
- Xopenpdata(&tech_pdata);
- Xputplanet(tech_pdata,p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
- X close_file(tech_pdata);
- X
- X deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0);
- X
- X sprintf(buf," New (ideal) tech production: %.3f (this planet)\n",
- X tech_prod((int)p->info[Playernum-1].tech_invest,
- X (int)p->info[Playernum-1].popn));
- X notify(Playernum, buf);
- X
- X
- X free(p);
- X
- X}
- X
- Xfloat tech_prod(investment, popn)
- Xint investment;
- Xint popn;
- X{
- Xfloat factor, scale;
- X
- Xscale = (float)popn/1000.;
- X
- Xreturn (TECH_INVEST * sqrt( (float)investment * scale));
- X}
- X
- X
- END_OF_FILE
- if test 2001 -ne `wc -c <'server/tech.c'`; then
- echo shar: \"'server/tech.c'\" unpacked with wrong size!
- fi
- # end of 'server/tech.c'
- if test -f 'server/toggle.c' -a "${1}" != "-c" ; then
- echo shar: Renaming existing file \"'server/toggle.c'\" to \"'server/toggle.c.orig'\"
- mv -f 'server/toggle.c' 'server/toggle.c.orig'
- fi
- echo shar: Extracting \"'server/toggle.c'\" \(2668 characters\)
- sed "s/^X//" >'server/toggle.c' <<'END_OF_FILE'
- X/*
- X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
- X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
- X * Restrictions in GB_copyright.h.
- X *
- X * toggle.c -- toggles some options
- X */
- X
- X#include "GB_copyright.h"
- X#define EXTERN extern
- X#include "vars.h"
- X#include "races.h"
- X#include "buffers.h"
- X#include <strings.h>
- Xint toggle_racedata;
- X
- Xtoggle(Playernum,APcount, argn, args)
- Xint Playernum;
- Xint APcount;
- Xint argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- Xint i;
- Xracetype *Race;
- X
- X openracedata(&toggle_racedata);
- X getrace(toggle_racedata, &Race, Playernum);
- X close_file(toggle_racedata);
- X
- X if (argn>1) {
- X i = strlen(args[1]);
- X
- X if (!strncmp(args[1],"inverse",i)) tog(Playernum,&Race->inverse,"inverse");
- X else if (!strncmp(args[1],"double_digits",i)) tog(Playernum,&Race->double_digits,
- X "double_digits");
- X else if (!strncmp(args[1],"geography",i)) tog(Playernum,&Race->geography,"geography");
- X else if (!strncmp(args[1],"gag",i)) tog(Playernum,&Race->gag,"gag");
- X else if (!strncmp(args[1],"autoload",i)) tog(Playernum,&Race->autoload,"autoload");
- X else if (!strncmp(args[1],"color",i)) tog(Playernum,&Race->color,"color");
- X else {
- X sprintf(buf,"No such option '%s'\n", args[1]);
- X notify(Playernum, buf);
- X free(Race);
- X return;
- X }
- Xopenracedata(&toggle_racedata);
- Xputrace(toggle_racedata, Race);
- Xclose_file(toggle_racedata);
- X
- X } else {
- X sprintf(buf,"gag is %s\n", Race->gag ? "ON" : "OFF");
- X notify(Playernum, buf);
- X sprintf(buf,"inverse is %s\n", Race->inverse ? "ON" : "OFF");
- X notify(Playernum, buf);
- X sprintf(buf,"double_digits is %s\n", Race->double_digits ? "ON" : "OFF");
- X notify(Playernum, buf);
- X sprintf(buf,"geography is %s\n", Race->geography ? "ON" : "OFF");
- X notify(Playernum, buf);
- X sprintf(buf,"autoload is %s\n", Race->autoload ? "ON": "OFF");
- X notify(Playernum, buf);
- X sprintf(buf,"color is %s\n", Race->color ? "ON": "OFF");
- X notify(Playernum, buf);
- X sprintf(buf, "highlight player %d\n", Race->highlight);
- X notify(Playernum, buf);
- X }
- Xfree(Race);
- X}
- X
- X
- Xhighlight(Playernum, APcount, argn, args)
- Xint Playernum;
- Xint APcount;
- Xint argn;
- Xchar args[MAXARGS][COMMANDSIZE];
- X{
- Xint n;
- Xracetype *alien, *Race;
- X
- XGetPlayer(args[1], &n, &alien);
- X if (n < 1 || n > Numraces() ) {
- X sprintf(buf,"No such player.\n");
- X notify(Playernum, buf);
- X return;
- X }
- X
- X openracedata(&toggle_racedata);
- X getrace(toggle_racedata, &Race, Playernum);
- X Race->highlight = n;
- X putrace(toggle_racedata, Race);
- X close_file(toggle_racedata);
- X free(alien);
- X free(Race);
- X
- X}
- X
- Xtog(Playernum,op, name)
- Xint Playernum;
- Xshort *op;
- Xchar *name;
- X{
- X *op = !(*op);
- X sprintf(buf, "%s is now %s\n", name, *op ? "on" : "off" );
- X notify(Playernum, buf);
- X}
- X
- END_OF_FILE
- if test 2668 -ne `wc -c <'server/toggle.c'`; then
- echo shar: \"'server/toggle.c'\" unpacked with wrong size!
- fi
- # end of 'server/toggle.c'
- echo shar: End of archive 9 \(of 9\).
- cp /dev/null ark9isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 9 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-